package com.qyhl.webtv.module_news.luckydraw.ticketsinfo;


import com.qyhl.webtv.commonlib.entity.news.LuckDrawInfoBean;

import java.util.List;

public class LuckDrawTicketsInfoPresenter implements LuckDrawTicketsInfoContract.LuckDrawTicketsInfoPresenter {
    private LuckDrawTicketsInfoActivity mView;
    private LuckDrawTicketsInfoModel mModel;

    LuckDrawTicketsInfoPresenter(LuckDrawTicketsInfoActivity mView) {
        this.mView = mView;
        this.mModel = new LuckDrawTicketsInfoModel(this);
    }

    @Override
    public void queryTicketsInfo(String phoneNum, String lastId) {
        mModel.queryTicketsInfo(phoneNum, lastId);
    }

    @Override
    public void queryTicketsInfoSuccess(List<LuckDrawInfoBean> beanList, boolean isMore) {
        mView.queryTicketsInfoSuccess(beanList, isMore);
    }

    @Override
    public void queryTicketsInfoError(int code, String msg) {
        switch (code) {
            case 0:
                mView.setNetError(msg);
                break;
            case 1:
                mView.showToast(msg);
                break;
            case 2:
                mView.setEmpty(msg);
                break;
            case 3:
                mView.setLog(msg);
                break;
            case 4:
                mView.queryTicketsInfoError(msg);
                break;
            case 5:
                mView.showToast(msg);
                break;
            default:
                break;
        }
    }
}
